/**
 * <copyright>
 * </copyright>
 *

 */
package info.unlp.tesis.qvtoperational.impl;

import info.unlp.tesis.qvtoperational.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class QvtoperationalFactoryImpl extends EFactoryImpl implements QvtoperationalFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static QvtoperationalFactory init()
  {
    try
    {
      QvtoperationalFactory theQvtoperationalFactory = (QvtoperationalFactory)EPackage.Registry.INSTANCE.getEFactory("http://qvtoperational"); 
      if (theQvtoperationalFactory != null)
      {
        return theQvtoperationalFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new QvtoperationalFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public QvtoperationalFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case QvtoperationalPackage.OPERATIONAL_TRANSFORMATION: return createOperationalTransformation();
      case QvtoperationalPackage.VAR_PARAMETER: return createVarParameter();
      case QvtoperationalPackage.MODEL_PARAMETER: return createModelParameter();
      case QvtoperationalPackage.MODEL_TYPE: return createModelType();
      case QvtoperationalPackage.IMPERATIVE_OPERATION: return createImperativeOperation();
      case QvtoperationalPackage.OPERATION_BODY: return createOperationBody();
      case QvtoperationalPackage.ENTRY_OPERATION: return createEntryOperation();
      case QvtoperationalPackage.OCL_EXPRESSION: return createOCLExpression();
      case QvtoperationalPackage.IF_EXP: return createIfExp();
      case QvtoperationalPackage.ASSIGN_EXP: return createAssignExp();
      case QvtoperationalPackage.IMPERATIVE_EXPRESSION: return createImperativeExpression();
      case QvtoperationalPackage.NULL_EXP: return createNullExp();
      case QvtoperationalPackage.BREAK_EXP: return createBreakExp();
      case QvtoperationalPackage.CONTINUE_EXP: return createContinueExp();
      case QvtoperationalPackage.WHILE_EXP: return createWhileExp();
      case QvtoperationalPackage.BOOLEAN_LITERAL_EXP: return createBooleanLiteralExp();
      case QvtoperationalPackage.VARIABLE_INIT_EXP: return createVariableInitExp();
      case QvtoperationalPackage.VARIABLE_WITH_TYPE: return createVariableWithType();
      case QvtoperationalPackage.DATA_TYPE: return createDataType();
      case QvtoperationalPackage.VARIABLE: return createVariable();
      case QvtoperationalPackage.STRING_LITERAL_EXP: return createStringLiteralExp();
      case QvtoperationalPackage.INTEGER_LITERAL_EXP: return createIntegerLiteralExp();
      case QvtoperationalPackage.OPERATION_CALL_EXP: return createOperationCallExp();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object createFromString(EDataType eDataType, String initialValue)
  {
    switch (eDataType.getClassifierID())
    {
      case QvtoperationalPackage.DIRECTION_KIND:
        return createDirectionKindFromString(eDataType, initialValue);
      case QvtoperationalPackage.BOOL:
        return createBoolFromString(eDataType, initialValue);
      case QvtoperationalPackage.OPERATION:
        return createOperationFromString(eDataType, initialValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String convertToString(EDataType eDataType, Object instanceValue)
  {
    switch (eDataType.getClassifierID())
    {
      case QvtoperationalPackage.DIRECTION_KIND:
        return convertDirectionKindToString(eDataType, instanceValue);
      case QvtoperationalPackage.BOOL:
        return convertBoolToString(eDataType, instanceValue);
      case QvtoperationalPackage.OPERATION:
        return convertOperationToString(eDataType, instanceValue);
      default:
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OperationalTransformation createOperationalTransformation()
  {
    OperationalTransformationImpl operationalTransformation = new OperationalTransformationImpl();
    return operationalTransformation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public VarParameter createVarParameter()
  {
    VarParameterImpl varParameter = new VarParameterImpl();
    return varParameter;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ModelParameter createModelParameter()
  {
    ModelParameterImpl modelParameter = new ModelParameterImpl();
    return modelParameter;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ModelType createModelType()
  {
    ModelTypeImpl modelType = new ModelTypeImpl();
    return modelType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ImperativeOperation createImperativeOperation()
  {
    ImperativeOperationImpl imperativeOperation = new ImperativeOperationImpl();
    return imperativeOperation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OperationBody createOperationBody()
  {
    OperationBodyImpl operationBody = new OperationBodyImpl();
    return operationBody;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EntryOperation createEntryOperation()
  {
    EntryOperationImpl entryOperation = new EntryOperationImpl();
    return entryOperation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OCLExpression createOCLExpression()
  {
    OCLExpressionImpl oclExpression = new OCLExpressionImpl();
    return oclExpression;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public IfExp createIfExp()
  {
    IfExpImpl ifExp = new IfExpImpl();
    return ifExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AssignExp createAssignExp()
  {
    AssignExpImpl assignExp = new AssignExpImpl();
    return assignExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ImperativeExpression createImperativeExpression()
  {
    ImperativeExpressionImpl imperativeExpression = new ImperativeExpressionImpl();
    return imperativeExpression;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NullExp createNullExp()
  {
    NullExpImpl nullExp = new NullExpImpl();
    return nullExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BreakExp createBreakExp()
  {
    BreakExpImpl breakExp = new BreakExpImpl();
    return breakExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ContinueExp createContinueExp()
  {
    ContinueExpImpl continueExp = new ContinueExpImpl();
    return continueExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public WhileExp createWhileExp()
  {
    WhileExpImpl whileExp = new WhileExpImpl();
    return whileExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BooleanLiteralExp createBooleanLiteralExp()
  {
    BooleanLiteralExpImpl booleanLiteralExp = new BooleanLiteralExpImpl();
    return booleanLiteralExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public VariableInitExp createVariableInitExp()
  {
    VariableInitExpImpl variableInitExp = new VariableInitExpImpl();
    return variableInitExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public VariableWithType createVariableWithType()
  {
    VariableWithTypeImpl variableWithType = new VariableWithTypeImpl();
    return variableWithType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DataType createDataType()
  {
    DataTypeImpl dataType = new DataTypeImpl();
    return dataType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Variable createVariable()
  {
    VariableImpl variable = new VariableImpl();
    return variable;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StringLiteralExp createStringLiteralExp()
  {
    StringLiteralExpImpl stringLiteralExp = new StringLiteralExpImpl();
    return stringLiteralExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public IntegerLiteralExp createIntegerLiteralExp()
  {
    IntegerLiteralExpImpl integerLiteralExp = new IntegerLiteralExpImpl();
    return integerLiteralExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public OperationCallExp createOperationCallExp()
  {
    OperationCallExpImpl operationCallExp = new OperationCallExpImpl();
    return operationCallExp;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DirectionKind createDirectionKindFromString(EDataType eDataType, String initialValue)
  {
    DirectionKind result = DirectionKind.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertDirectionKindToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Bool createBoolFromString(EDataType eDataType, String initialValue)
  {
    Bool result = Bool.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertBoolToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Operation createOperationFromString(EDataType eDataType, String initialValue)
  {
    Operation result = Operation.get(initialValue);
    if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String convertOperationToString(EDataType eDataType, Object instanceValue)
  {
    return instanceValue == null ? null : instanceValue.toString();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public QvtoperationalPackage getQvtoperationalPackage()
  {
    return (QvtoperationalPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static QvtoperationalPackage getPackage()
  {
    return QvtoperationalPackage.eINSTANCE;
  }

} //QvtoperationalFactoryImpl
